Skip to content

Avoid deprecated spl_object_hash() on PHP 8.6 - #301

Open
andypost wants to merge 1 commit into
bovigo:masterfrom
andypost:php86-spl-object-id-master
Open

andypost wants to merge 1 commit into
bovigo:masterfrom
andypost:php86-spl-object-id-master

Conversation

@andypost

Copy link
Copy Markdown

PHP 8.6 deprecates spl_object_hash() in favor of spl_object_id(), which is available on all PHP versions supported by this branch. Cast the ID to string to preserve getResourceId()'s string return type.

Companion to #300, which targets the v1.6 release branch with a PHP 7.1 fallback.

Fixes #299

PHP 8.6 deprecates spl_object_hash() in favor of spl_object_id(),
which is available on all supported PHP versions. Cast the ID to
string to preserve getResourceId()'s return type.

Fixes bovigo#299
@beryllium

Copy link
Copy Markdown

Just noticed this in one of my own projects that uses vfsStream in its unit tests. Thanks for starting a PR :) Hopefully the maintainer will have a chance to take a look.

acoulton added a commit to acoulton/Gherkin that referenced this pull request Nov 6, 2026
mikey179/vfstream triggers deprecations on PHP 8.6 due to use of
`spl_object_hash`. Patch it on installation, using the fix proposed in
bovigo/vfsStream#301.
acoulton added a commit to acoulton/Gherkin that referenced this pull request Nov 6, 2026
mikey179/vfstream triggers deprecations on PHP 8.6 due to use of
`spl_object_hash`. Patch it on installation, using the fix proposed in
bovigo/vfsStream#301.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.6 compatibility

2 participants